﻿@model slogan_info

@using (Html.BeginForm("SloganEdit", "Work", Html.ViewContext.RouteData.Values, FormMethod.Post))
{
    @Html.AntiForgeryToken()
    @Html.HiddenFor(a=>a.id)
    <div id="edit-car" style="width:900px;margin:5px 5px 5px 5px">

        <table class="edit-table">
            <tr>
                <td style="width: 120px; text-align: right;">*详细内容：</td>
                <td colspan="3">@Html.TextAreaFor(a => a.note,5,30,new { @style = "width: 100%;"})</td>
            </tr>
            
            <tr>
                <td style="width: 120px; text-align: right">是否生效：</td>
                <td>@Html.CheckBoxFor(a=>a.is_use)</td>
            </tr>
        </table>
        <br />
        <div class="validation-errors">@ViewBag.ErrorMessage</div>
    </div>
    <table style="width:900px">
        <tr>
            <td style="width:850px"></td>
            <td>
                @Html.DevExpress().Button(settings =>
                {
                    settings.Name = "Button1";
                    settings.Text = "保存";
                    //settings.Enabled = CurrentUser.CheckPermission(PermissionManager.填写GPS统计表);
                    settings.UseSubmitBehavior = false;
                    settings.Width = 70;
                    settings.ControlStyle.CssClass = "button1";
                    settings.ClientSideEvents.Click = "function(s, e){ commit_data();}";
                }).GetHtml()

            </td>
            <td>
                @Html.DevExpress().Button(settings =>
                {
                    settings.ControlStyle.CssClass = "button2";
                    settings.Name = "Button2";
                    settings.Text = "取消";
                    settings.Width = 70;
                    settings.ClientSideEvents.Click = "function(s, e){ location.href='" + @Url.Action("SloganList", "Work") + "' }";
                }).GetHtml()
            </td>
        </tr>

    </table>
    
    <script type="text/javascript">
        
        function commit_data() {
            if ($("#note").val() == null || $("#note").val() == "") {
                alert("请输入内容。");
                return;
            }
            
            document.forms[0].submit();
        };
    </script>
}